package com.flyxiaozhu.erp.core.repositories;

import com.flyxiaozhu.erp.core.entities.App;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface AppRepository extends JpaRepository<App, Long>, JpaSpecificationExecutor<App> {
    List<App> findByStatus(int status);

    @Query("select count(a) from App a where a.key = ?1")
    Integer exitsByKey(String key);
}
